﻿using System.Collections.Generic;
using Dapper;
using ZilLion.Service.Core.DapperWrapper;
using ZilLion.Service.Core.DapperWrapper.SqlServer;
using ZilLion.Service.Crm.CommonRepository;
using ZilLion.Service.WechatService.Domain.WebApiEntity.WechatCardModel;
using ZilLion.Service.WechatService.Domain.WebApiRepository.InterFace;

namespace ZilLion.Service.WechatService.Domain.WebApiRepository
{
    public class AccOprInfoRepository : CrmSqlServerRespository<OprInfo>, IAccOprInfoRepository
    {
        public AccOprInfoRepository(long? accid) : base(accid)
        {
        }

        public AccOprInfoRepository(IDbContext context, long? accid) : base(context)
        {
            this.Accid = accid.GetValueOrDefault();
        }

        public IEnumerable<OprInfo> GetBalanceChanges()
        {
            OprInfo info = new OprInfo();
            DynamicParameters p = CreateDynamicParameters(
                 new ParamModel(ParamLabel: "accid", Val: Accid)
                  );
            var item = ExecuteProcWithTemptable(info, "pr_AccOprInfo_WebQueryBalanceChange_new", "#OprInfo", false, p);
            return item;
        }
    }
      
}